/* 
 * File:   DielectricShader.h
 * Author: brady
 *
 * Created on February 16, 2011, 1:41 AM
 */

#include "BlinnPhongShader.h"
#include <math.h>
#ifndef DIELECTRICSHADER_H
#define	DIELECTRICSHADER_H

class DielectricShader : public BlinnPhongShader {
public:
    DielectricShader();
    DielectricShader(double r, double g, double b, double sr, double sg, double sb);
    DielectricShader(const DielectricShader& orig);
    virtual ~DielectricShader();
    Vector3D Shade(Ray &viewingRay, HitStruct& hitStruct, Scene* scene);
    void SetTransparency(double t){Transparency = t;}
    void SetRIndex(double r){rIndex = r;}
protected:
    Vector3D Refract(Vector3D &normal, Vector3D &viewDir, double riOld, double riNew);
    Vector3D ComputeRefractions(Ray &hitRay, Vector3D &normal, Scene* scene);
    double Transparency;
    double rIndex;
};

#endif	/* DIELECTRICSHADER_H */

